using UnityEngine;
using System.Collections;

public class SpecialCubeBlackAndWhite : MonoBehaviour {
		
	void Start()
	{
		StartCoroutine("SwitchColor");
	}
	
	IEnumerator SwitchColor()
	{
		yield return new WaitForSeconds(0.1f);
		
		int currentColor = (int) renderer.material.color.r;
		
		switch(currentColor)
		{
		case 0:
			currentColor = 1;
			break;
		case 1:
			currentColor = 0;
			break;
		}
		
		Color color = new Color(currentColor,currentColor,currentColor,renderer.material.color.a);
		renderer.material.color = color;
		StartCoroutine("SwitchColor");
	}
}
